package com.itheima.demo02;

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.Month;

public class MainDemo02 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2020,11,11,11,11,11);
        int year = localDateTime.getYear();
        System.out.println(year + "年");
        int month = localDateTime.getMonthValue();
        System.out.println(month + "月");
        Month month1 = localDateTime.getMonth();
        System.out.println(month1);
        int dayOfYear = localDateTime.getDayOfYear();
        System.out.println(dayOfYear);
        int dayOfMonth = localDateTime.getDayOfMonth();
        System.out.println(dayOfMonth);

        DayOfWeek week = localDateTime.getDayOfWeek();
        System.out.println("星期：" + week);
        int hour = localDateTime.getHour();
        System.out.println("小时：" + hour);
        int minute = localDateTime.getMinute();
        System.out.println("分钟" + minute);
        int second = localDateTime.getSecond();
        System.out.println("秒：" + second);
    }
}
